/**
 * 
 */
package cn.com.dragonsoftbravo.utils.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;

/**
 * @copyright Promoters Sell-thru System, ISSG, Sony China
 *
 * @author William
 *
 */
public final class RequestUtils {
	
	/**
	 * check the request URI is for Mobile API or not
	 * if the API path contains the string "mobile/api", return true
	 * 
	 * @param request
	 * @return
	 */
	public static boolean isMobileAPI(HttpServletRequest request){
		
		boolean mobileAPI=false;
		
		if(null!=request){
			String url=request.getRequestURI();
			if(StringUtils.isNotBlank(url) && url.indexOf("mobile")>-1){
				mobileAPI=true;
			}
		}
		
		return mobileAPI;
		
	}
	

}
